﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <H1>
Data Grid
</H1>
    <br />
    <asp:ListBox ID="lstIds" runat="server"
        DataSourceID="sqlDS1" Height="70px" 
         Width="217px" 
        DataTextField="ID" AutoPostBack="True"></asp:ListBox>
    <br />
    <br />
    <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDS2" 
        AutoGenerateColumns="true" Width="431px">
    </asp:GridView>
    <br />

<asp:SqlDataSource ID = "sqlDS1" runat="server" ProviderName="System.Data.SqlClient" ConnectionString="<%$ ConnectionStrings:Northwind %>"
                    SelectCommand= "select Merchant_ID as ID from NBE_Merchant" />

                    <asp:SqlDataSource ID = "SqlDS2" runat="server" ProviderName="System.Data.SqlClient" ConnectionString="<%$ ConnectionStrings:Northwind %>"
                    SelectCommand="SELECT POS_Mach_SN, POs_Mach_Location FROM POS_Machine WHERE POs_Mach_Location=@loc">
                    
                    <SelectParameters>
                    <asp:ControlParameter ControlID="lstIds" Name="loc" PropertyName="SelectedValue" />
                    </SelectParameters>
                     </asp:SqlDataSource>
    </asp:Content>

